# Contributor: 6543 <6543@obermui.de>
# Maintainer: 6543 <6543@obermui.de>
pkgname=check-jsonschema
pkgver=0.27.2
pkgrel=0
pkgdesc="A JSON Schema CLI built on jsonschema. The schema may be specified as a local or remote (HTTP or HTTPS) file"
url="https://github.com/python-jsonschema/check-jsonschema"
arch="all !s390x" # s390x is not supported because py3-regress is missing for that arch
license="Apache-2.0"
depends="
	py3-jsonschema
	py3-regress
	py3-requests
	py3-ruamel
	py3-responses
	py3-click
	python3
	"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="
	py3-pytest
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-jsonschema/check-jsonschema/archive/refs/tags/$pkgver.tar.gz"

options="!check" # check fail but cli work as expected

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
ab28b7f68e7f7b61e8aef052b1d3982755d3f7d81672b00c0d4bf4110795063e26537b3c85ea3412e51931bcb67380639510ad9b8a457ffd9065f225beb09051  check-jsonschema-0.27.2.tar.gz
"
